import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter_demo/services/api.dart';

class HomeProvider extends ChangeNotifier {
  String activeDate = '';
  List books = [];
  int currIndex = 0;

  Future getActiveInfo() async {
    final res = await Home.Index();
    final info = jsonDecode(res.toString());
    activeDate = info['activeDate'];
    books = info['books'];
    notifyListeners();
  }

  void setCurrIndex(int index){
    currIndex = index;
    notifyListeners();
  }

}